﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.XPath;

using Stanza.MSBuild.Tasks;

namespace PublishVisualStudioProject
{
    class Program
    {
        static void Main( string[] args )
        {
            try
            {
                if( args.Length != 1 )
                    PrintUsage();
                else
                {
                    Publish p = new Publish( Console.WriteLine );
                    p.PublishSolution( args[0] );
                }
            }
            catch( Exception ex )
            {
                Console.WriteLine( "Error:" );
                for( Exception x=ex; x != null; x = x.InnerException )
                    Console.WriteLine( "  {0}-{1}", x.GetType().FullName, x.Message );
            }
            if( System.Diagnostics.Debugger.IsAttached )
            {
                Console.Write( "Press Enter: " );
                Console.ReadLine();
            }
        }

        static void PrintUsage()
        {
            Console.WriteLine( @"
Usage:

    PublishVisualStudioProject <PublishFileName>

Where:

    <PublishFileName>
        - The name of the XML file containing the information about 
" );
        }
    }
}
